/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

#ifndef __LAYER_MANAGER_H
#define __LAYER_MANAGER_H

class GPSMap;

#include "gtkMap.h"

typedef struct _AnchorType_t {
	GtkAnchorType anchor;
	int x;
	int y;
} AnchorType_t;

#define N_ANCHORS 6
extern AnchorType_t Anchors[N_ANCHORS];

class LayerManager
{
	protected:
		bool isShown;

		// parent gps_map
		GPSMap * gps_map; 
		// convienence pointer for my layer's group
		GooCanvasItem *layerG;

	public:
		LayerManager(); // pure virtual class, only init
		virtual ~LayerManager(); // pure virtual class, only init

		virtual void init(GPSMap *map = NULL); 

		// must be defined by derived class
		virtual void updateMap() = 0; // called by layer_timeout_cb
		virtual void translate_from_zoomChange(double zoom_factor) = 0;

		// functions for all layers
		virtual bool setShown(int setTo = -1);

		// this is the time out function, we use polymorphism to call the correct
		// derived class updateMap from this function
		static gboolean layer_timeout_cb(gpointer user_data);
};

#endif
